//接口地址、网络资源地址前缀
//#ifdef H5
export const API_PREFIX = '/api/'
export const RES_PREFIX = '/static/'
//#endif

//#ifndef H5
export const API_PREFIX = 'https://dev2022.h5atm.com/api/'
export const RES_PREFIX = 'https://dev2022.h5atm.com/static/'

// export const API_PREFIX = 'http://127.0.0.1:8081/api/'
// export const RES_PREFIX = 'http://127.0.0.1:8081/static/'
//#endif

export const STORAGE_KEYS = {
	AD: 'sk_ad'
}

export const COMMON_SHARE = {
    title: '分享标题',
    path: '/pages/map/map',
    imageUrl: RES_PREFIX+'shareicon.jpg'
}

export const THIRD_MINI_APP = {
	appid: '',
	path: ''
}

export const SETTINGS = {
	TICKET_URL: '',
	PUNCH_URL: '',
	AD_TIMES: 0,
	AD_URL: '',
	HAIKAN_URL: '',
	EXCHARGE_RULES_URL: '',
	EXCHARGE_TIME_URL: '',
}

//展位列表
export const POSITIONS = [
	{
		code: "A",
		type: 1,
		event: 'sp_exhib',
		label: {
			src: '/static/map/labels/1_1.png',
			left: '12rpx',
			top: '140rpx',
			width: '167rpx',
			height: '36rpx'
		},
		icon: {
			src: '/static/map/icons/3_1.png',
			left: '6rpx',
			top: '33rpx',
			width: '93rpx',
			height: '103rpx'
		},
		hot: {
			left: '108rpx',
			top: '17rpx'
		},
		rect: {
			left: '710rpx',
			top: '620rpx'
		}
	},
	{
		code: "H",
		type: 1,
		label: {
			src: '/static/map/labels/1_3.png',
			left: '12rpx',
			top: '140rpx',
			width: '228rpx',
			height: '36rpx'
		},
		icon: {
			src: '/static/map/icons/3_2.png',
			left: '6rpx',
			top: '32rpx',
			width: '93rpx',
			height: '102rpx'
		},
		hot: {
			left: '108rpx',
			top: '17rpx'
		},
		rect: {
			left: '1333rpx',
			top: '765rpx'
		}
	},
	{
		code: "B",
		type: 1,
		event: 'sp_esport',
		label: {
			src: '/static/map/labels/1_4.png',
			left: '12rpx',
			top: '140rpx',
			width: '232rpx',
			height: '36rpx'
		},
		icon: {
			src: '/static/map/icons/3_1.png',
			left: '6rpx',
			top: '33rpx',
			width: '93rpx',
			height: '102rpx'
		},
		hot: {
			left: '108rpx',
			top: '17rpx'
		},
		rect: {
			left: '1050rpx',
			top: '510rpx'
		}
	},
	{
		code: "C",
		type: 1,
		event: 'sp_jd',
		label: {
			src: '/static/map/labels/1_5.png',
			left: '12rpx',
			top: '140rpx',
			width: '222rpx',
			height: '36rpx'
		},
		icon: {
			src: '/static/map/icons/3_1.png',
			left: '6rpx',
			top: '33rpx',
			width: '93rpx',
			height: '102rpx'
		},
		hot: {
			left: '108rpx',
			top: '17rpx'
		},
		rect: {
			left: '1465rpx',
			top: '475rpx'
		}
	},
	{
		code: "D",
		type: 1,
		event: 'sp_power',
		label: {
			src: '/static/map/labels/1_6.png',
			left: '12rpx',
			top: '140rpx',
			width: '132rpx',
			height: '36rpx'
		},
		icon: {
			src: '/static/map/icons/3_1.png',
			left: '6rpx',
			top: '33rpx',
			width: '93rpx',
			height: '102rpx'
		},
		hot: {
			left: '104rpx',
			top: '6rpx'
		},
		rect: {
			left: '1660rpx',
			top: '435rpx'
		}
	},
	{
		code: "E",
		type: 1,
		event: 'sp_car',
		label: {
			src: '/static/map/labels/1_7.png',
			left: '12rpx',
			top: '140rpx',
			width: '192rpx',
			height: '36rpx'
		},
		icon: {
			src: '/static/map/icons/3_1.png',
			left: '6rpx',
			top: '33rpx',
			width: '93rpx',
			height: '102rpx'
		},
		hot: {
			left: '108rpx',
			top: '17rpx'
		},
		rect: {
			left: '1872rpx',
			top: '476rpx'
		}
	},
	{
		code: "F",
		type: 1,
		event: 'sp_8k',
		label: {
			src: '/static/map/labels/1_8.png',
			left: '12rpx',
			top: '140rpx',
			width: '192rpx',
			height: '36rpx'
		},
		icon: {
			src: '/static/map/icons/3_1.png',
			left: '6rpx',
			top: '33rpx',
			width: '93rpx',
			height: '102rpx'
		},
		hot: {
			left: '108rpx',
			top: '17rpx'
		},
		rect: {
			left: '2354rpx',
			top: '470rpx'
		}
	},
	{
		code: "I",
		type: 1,
		label: {
			src: '/static/map/labels/1_9.png',
			left: '2rpx',
			top: '136rpx',
			width: '219rpx',
			height: '37rpx'
		},
		icon: {
			src: '/static/map/icons/3_1.png',
			left: '6rpx',
			top: '33rpx',
			width: '93rpx',
			height: '102rpx'
		},
		hot: {
			left: '108rpx',
			top: '17rpx'
		},
		rect: {
			left: '980rpx',
			top: '776rpx'
		}
	}
]

export const initConfig = (config)=>{
	//分享
	COMMON_SHARE.title = config.share.title
	COMMON_SHARE.path = config.share.path
	COMMON_SHARE.imageUrl = `${RES_PREFIX}${config.share.imageUrl}`
	
	//第三方小程序
	THIRD_MINI_APP.appid = config.mini.appid
	THIRD_MINI_APP.path = config.mini.path
	
	//其他配置
	SETTINGS.TICKET_URL = config.links.ticket
	SETTINGS.PUNCH_URL = config.links.punch
	SETTINGS.AD_TIMES = config.settings.adTimes
	SETTINGS.HAIKAN_URL = `${RES_PREFIX}${config.settings.haikan}`
	SETTINGS.EXCHARGE_RULES_URL = config.settings.exchargeRulesUrl
	SETTINGS.EXCHARGE_TIME_URL = `${RES_PREFIX}${config.settings.exchargeTimeUrl}`
	SETTINGS.AD_URL = `${RES_PREFIX}${config.settings.adGif}`
}